<?php
/***********************
 *   SETUP FRAMEWORK
 ***********************/
$frameworkDir = dirname(dirname(dirname(dirname(__FILE__))));
require_once $frameworkDir . '/vega.php';
require_once 'Vega/Router/Standard.php';

$app->setupApp('viettel_mobitv_admin');
require_once APP_PATH.DS.'config/predefined.php';
require_once APP_PATH.DS.'helpers/common.helper.php';

//Append local config
$localConfig = $app->loadConfig('local', 'localConfig');
$app->coreConfig = array_merge_recursive($app->coreConfig, $localConfig);

require_once 'Vega/Db/Mysql.php';
$db = new Vega_Db_Mysql($app->coreConfig['database']['master'], $app->coreConfig['database']['slave']);

require_once 'Vega/Dao.php';
Vega_Dao::setDb($db);
Vega_Dao::setLoader($app->getLoader());
Vega_Dao::setLoader(Vega_App::getInstance()->getLoader());
